import {
	request
} from "./request.js";

export const getPostList = (data = {}) => {
	return request({
		url: "/community/post/list",
		data
	})
}
export const addLike = (data = {}) => {
	return request({
		url: '/community/post/toggle',
		method: "POST",
		data
	})
}

export const getPostDetail = (data = {}) => {
	return request({
		url: `/community/post/detail/${data.postId}/${data.userId}`
	})
}

export const createComment = (data = {}) => {
	return request({
		url: '/community/comment/create',
		method: "POST",
		data
	})
}

export const createPost = (data = {}) => {
	return request({
		url: '/community/post/create',
		method: "POST",
		data
	})
}
export const deletePostAPI = (data = {}) => {
	return request({
		url: `/community/post/delete/${data.postId}/${data.userId}`,
		method: "DELETE",
	})
}